<?php

namespace Admin\Controller;


class BingzhongController extends BaseController {
	public function index(){
		$list = D('bingzhong')->order('id desc')->select();
		$this->assign('list',$list);
		$this->display();
	}
	public function add(){
		if(IS_POST){
			$bz = $_POST['bz_name'];
			$bz_arr = explode(',',$bz);
			foreach($bz_arr as $v){
				$date['bz_name']=$v;
				$date['inputtime']=time();
				$date['cat_id']=$_POST['cat_id'];
				$r = D('bingzhong')->add($date);
				if($r){
					$this->success("操作成功",U('Admin/Bingzhong/index'));
				}else{
					$this->error("操作失败",U('Admin/Bingzhong/index'));
				}
			}
			
			
		}
		$this->display();
	}
}


?>